package com.qf.dao;

import com.qf.bean.Teacher;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.CrudRepository;

import javax.swing.text.TabableView;
import java.util.List;

public interface TeacherDao extends JpaRepository<Teacher,Integer> {
    //查询全部数据，并分页展示
    public Page<Teacher> findByTidIn(List list, Pageable pageable);

    //查询所有学生,要求根据出生日期降序排序  sort排序规则
    public List<Teacher> findAll(Sort sort);
    //count查询
    public int  countByTnameContaining(String name);
    //in查询
    public List<Teacher> findByTidIn(List<Integer> ids);
    //根据姓名进行模糊查询
    public List<Teacher> findByTnameLike(String name);//参数  %张%
    public List<Teacher> findByTnameContaining(String name);//参数   张    %张%
    public List<Teacher> findByTnameStartingWith(String name);// 参数  张   张%
    //大于
    public List<Teacher> findByTidGreaterThan(int tid);

    //根据姓名和性别查询
    public List<Teacher> findByTnameAndTsex(String sname,String sex);
    //根据id区间查询
    public List<Teacher> findByTidBetween(int begin,int end);
}
